package com.wmuj.controller;

import com.wmuj.pojo.OperLogQueryParam;
import com.wmuj.pojo.OperateLog;
import com.wmuj.pojo.PageResult;
import com.wmuj.pojo.Result;
import com.wmuj.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RequestMapping("/log")
@RestController
public class LogPageController {

  @Autowired private LogService logService;

  // get方法获得日志
  @GetMapping("/page")
  public Result getLogInfo(OperLogQueryParam operLogQueryParam) {
    log.info("操作日志....");
    // 分页查询
    PageResult<OperateLog> operateLog = logService.getLogList(operLogQueryParam);
    return Result.success(operateLog);
  }
}
